package cn.ph.activiti;

import org.activiti.engine.ProcessEngine;
import org.activiti.engine.ProcessEngines;
import org.activiti.engine.RepositoryService;
import org.activiti.engine.repository.Deployment;

/**
 * 2. 流程定义部署
 * activiti的表有哪些
 */
public class ActivitiDeployment {
  public static void main(String[] args) {
    //1. 创建ProcessEngine对象
   ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
   //2. 得到实例HistoryService
    RepositoryService repositoryService = processEngine.getRepositoryService();
    //3. 进行部署,  act_re_deployment表中添加了此条部署信息记录
    Deployment deployment = repositoryService.createDeployment()
        .addClasspathResource("diagrams/holiday.bpmn")  //添加bpmn资源
        .addClasspathResource("diagrams/holiday.png")
        .name("请假申请单流程")
        .deploy();
  }
}
